package com.qianjiangcloud.store.util;

import com.qianjiangcloud.store.modle.MainModules;

import java.util.Comparator;

/**
 * Created by caojian on 16/7/8.
 */
public class MainModulesComparator implements Comparator<MainModules> {
    @Override
    public int compare(MainModules lhs, MainModules rhs) {
        //无排序字段的设置为最后
        int i = 100, j = 100;
        if(lhs.module_sort != null){
            i=Integer.parseInt(lhs.module_sort);
        }

        if(rhs.module_sort != null){
            j = Integer.parseInt(rhs.module_sort);
        }

        if (i<j){
            return -1;
        }else if(i>j){
                return 1;
        }else {
            return 0;
        }
    }
}
